<template>
  <div id="MerchantInfo">
    <section class="l-top">
      <van-image fit="cover" :src="randomPic" class="l-top__img"/>
      <div class="l-top__wrap">
        <h3 class="l-top__title">{{ infoData.name }}</h3>
        <ul class="l-top__addr">
          <li><label class="l-top__label">地址：</label>{{ addrFmt(infoData) }}{{infoData.address}}</li>
          <li><label class="l-top__label">产业范围：</label>{{infoData.cyrange}}</li>
        </ul>
      </div>
    </section>
    <div class="l-bottom">
      <header class="l-bottom__header">详细介绍</header>
      <p v-html="infoData.details"/>
      <div class="l-bottom__btn active-able" @click="onSubmit">我要入驻</div>
    </div>
  </div>
</template>
<script lang="ts">
import Vue, {ComponentOptions, VueConstructor} from "vue"
import Component from 'vue-class-component'
import {Prop} from "vue-property-decorator";
import {requestByGet} from "@/utils/request";

export const title = ""
@Component
export default class MerchantInfo extends Vue implements ComponentOptions<Vue> {
  name = "MerchantInfo"
  @Prop() customId!: any;
  infoData = {}

  async created() {
    this.infoData = await requestByGet(`/qqc/qqcSpaceentry/queryById`, {id: this.customId})
  }
  onSubmit(){
    this.$dialog.alert({message:"请联系工作人员：18767198423"})
  }
}
</script>

<style scoped lang="scss">
@import "~assets/common.scss";

#MerchantInfo {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  .l-top {
    background: white;

    &__wrap {
      padding: 10px;
    }

    &__img {
      width: 100%;
      height: 250px;
    }

    &__title {
      font-size: 18px;
      margin: 6px 0;
    }

    &__addr {
      line-height: 1.6;
      padding-left: 2px;
    }

    &__label {
      color: $p-color;
    }
  }

  .l-bottom {
    padding: 12px;
    flex: 1;
    margin-top: 10px;
    background: white;
    font-size: 14px;
    line-height: 1.4;

    &__header {
      margin-bottom: 10px;
      font-size: 16px;
    }

    &__btn {
      position: fixed;
      height: 44px;
      line-height: 44px;
      color: white;
      border-radius: 4px;
      left: 10px;
      right: 10px;
      bottom: 10px;
      text-align: center;
      background: #349e7e;
    }
  }
}
</style>
